<?php
/**
 * 公共类
 * Created by PhpStorm.
 * User: crstu
 * Date: 2016/4/25
 * Time: 16:56
 */

namespace backend\controllers;

use backend\commands\BaseAdminController;
use backend\models\Service\AdminService;
use yii;

class PublicController extends BaseAdminController
{

    public function actionIndex(){
        echo 'Public/Index';
    }

    /**
     * 获取菜单
     * @return string 返回JSON数据
     */
    public function actionGetMenuData(){
        $request = Yii::$app->request;
        if($request->isAjax){
            $menu = AdminService::initPower($this->admin_role_id);
            return $this->renderJson(1, $menu);
        }
        return false;
    }

    public function actionError(){
        echo 'Error';
        die;
    }
    
}